package com.gec.mall.document;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @Author: li
 * @Date: 2023/2/15
 * @PACKAGE_NAME:com.gec.mall.document
 * @Project_Name:mall-parent
 * @VERSION: 1.0.0
 */
@Data
@Document(indexName = "mall_items")
public class EsItem implements Serializable {
    @Id
    private Long id;

    /**
     * 商品标题
     *
     * @mbg.generated
     */
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String title;

    /**
     * 商品卖点
     *
     * @mbg.generated
     */
    private String sellPoint;

    /**
     * 商品价格，单位为：元
     *
     * @mbg.generated
     */
    private BigDecimal price;

    private String image;

    private Long goodsId;

    @Field(type = FieldType.Keyword)        //如果要聚合统计，但不作分词
    private String category;
    @Field(type = FieldType.Keyword)
    private String brand;

    @Field(analyzer = "ik_smart",type = FieldType.Text)
    private String seller;
}
